import java.util.*;

public class PrimeNumbers {
    public static void main(String[] args) {
        Scanner inputFromKeybord = new Scanner(System.in);
        
        System.out.println("Please imput your number");
        int inputIntegerNumber = inputFromKeybord.nextInt();
        if (inputIntegerNumber < 0) {
            System.out.println("Input value must be more than 0");
            return;
        }
        
        System.out.print("Prime numbers:");
        for (int possiblePrimeNumber = 2; possiblePrimeNumber <= inputIntegerNumber; possiblePrimeNumber++) {
            boolean  isNotPrimeNumber = false;
            for (int checkNumber = 2; checkNumber < possiblePrimeNumber; checkNumber++) {
                if (possiblePrimeNumber % checkNumber == 0) {
                    isNotPrimeNumber = true;
                    break;
                }                                
            }
            if (isNotPrimeNumber == false) {
                System.out.print(possiblePrimeNumber+ " ");
            }
        }
        System.out.println("");
        
    }
}